package com.example.inoculations.controller;

import com.example.inoculations.resultR.R;
import com.example.inoculations.service.IFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


@RestController
@RequestMapping("/file")
public class FileController {

    @Autowired
    private IFileService fileService;

    @PostMapping("/admin/upload")
    public R upload(@RequestParam("filename") MultipartFile file) {
        System.out.println(file+"aaaa");
        return R.SUCCESS(fileService.upload(file));
    }
}
